Optimal. Leaf size=23 \[ B \log (1-\cos (x))-\frac {A \sin (x)}{1-\cos (x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {4486, 2727,
2746, 31} \begin {gather*} B \log (1-\cos (x))-\frac {A \sin (x)}{1-\cos (x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 2727
Rule 2746
Rule 4486
Rubi steps
\begin {align*} \int \frac {A+B \sin (x)}{1-\cos (x)} \, dx &=\int \left (-\frac {A}{-1+\cos (x)}-\frac {B \sin (x)}{-1+\cos (x)}\right ) \, dx\\ &=-\left (A \int \frac {1}{-1+\cos (x)} \, dx\right )-B \int \frac {\sin (x)}{-1+\cos (x)} \, dx\\ &=-\frac {A \sin (x)}{1-\cos (x)}+B \text {Subst}\left (\int \frac {1}{-1+x} \, dx,x,\cos (x)\right )\\ &=B \log (1-\cos (x))-\frac {A \sin (x)}{1-\cos (x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 20, normalized size = 0.87 \begin {gather*} -A \cot \left (\frac {x}{2}\right )+2 B \log \left (\sin \left (\frac {x}{2}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.05, size = 31, normalized size = 1.35
method | result | size |
default | \(-\frac {A}{\tan \left (\frac {x}{2}\right )}+2 B \ln \left (\tan \left (\frac {x}{2}\right )\right )-B \ln \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )\) | \(31\) |
risch | \(-i B x -\frac {2 i A}{{\mathrm e}^{i x}-1}+2 B \ln \left ({\mathrm e}^{i x}-1\right )\) | \(31\) |
norman | \(\frac {-A -A \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right ) \tan \left (\frac {x}{2}\right )}+2 B \ln \left (\tan \left (\frac {x}{2}\right )\right )-B \ln \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )\) | \(52\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 19, normalized size = 0.83 \begin {gather*} B \log \left (\cos \left (x\right ) - 1\right ) - \frac {A {\left (\cos \left (x\right ) + 1\right )}}{\sin \left (x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 25, normalized size = 1.09 \begin {gather*} \frac {B \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) \sin \left (x\right ) - A \cos \left (x\right ) - A}{\sin \left (x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.22, size = 27, normalized size = 1.17 \begin {gather*} - \frac {A}{\tan {\left (\frac {x}{2} \right )}} - B \log {\left (\tan ^{2}{\left (\frac {x}{2} \right )} + 1 \right )} + 2 B \log {\left (\tan {\left (\frac {x}{2} \right )} \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 39, normalized size = 1.70 \begin {gather*} -B \log \left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right ) + 2 \, B \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right ) - \frac {2 \, B \tan \left (\frac {1}{2} \, x\right ) + A}{\tan \left (\frac {1}{2} \, x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.21, size = 30, normalized size = 1.30 \begin {gather*} 2\,B\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )-\frac {A}{\mathrm {tan}\left (\frac {x}{2}\right )}-B\,\ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________